<script setup lang="ts">
import { ref } from "vue";
let money = ref(1000);
const run = () => {
  console.log("I can run");
}
// 组件内部数据对外关闭(封装思想)
// 如果要访问该数据则需要使用defineExpose方法对外暴露数据
defineExpose({
  money,
  run
})
</script>

<template>
  <div class="son">
       <h2>我是儿子组件:money:{{money}}</h2>
  </div>
</template>

<style scoped>
.son {
  width: 300px;
  height: 300px;
  background: salmon;
}
</style>